Low-level system software, for example, a BIOS, has historically been written in assembly language. As systems have evolved and become more complex, additional functions have been developed using a high-level language, for example C. Since access to certain instructions and/or registers is generally unavailable in a high-level language, assembly language code is likely to remain in use.
It is common in applications that include assembly code and high-level code to reference the same data structure in both the assembly code and in the high-level code. To support the references in the different languages, however, requires special measures since high-level language references are unsupported in assembly language code.
One approach for dealing with references to data structures in applications having assembly and high-level code uses a utility to convert a file having a high-level language data structure into the target assembly language. This approach is limited by the capabilities of the target assembly language to define data structures. Thus, with some assemblers, only simple data structures may be shared between the assembly and high-level code.
Another approach uses a utility to translate high-level language data structures into assembly “equate” statements. This approach requires the generation of equate statements for all addressable elements of a data structure. Thus, for complex data structures, for example, nested structures and arrays of structures, generation of suitable equate statements is impractical.
A method and apparatus that addresses the aforementioned problems, as well as other related problems, are therefore desirable.